<?php
require_once 'BaseController.php';

/**
 * 【SP版】検索条件で問い合わせ コントローラ
 */
class Mobileapi_ConditionsentryController extends Mobileapi_BaseController
{

    /**
     * メインアクション
     */
    public function indexAction()
    {
        $params = $this->getParameters();
        $step = $params["Step"];

        $this->makeTemplateParams($params);

        if (empty($step))
        {
            $this->displayBody2('index');
        }
        else if ($step == 'complete')
        {
            // ★★★検討リスト
            $this->loadData();

            $this->displayBody2('complete');
        }
    }

    public function collectShopcdFromParams($params)
    {
        foreach ($params as $k => $v)
        {
            if (substr($k, 0, 6) == 'shopcd')
            {
                if ($shopcd . length > 0)
                {
                    $shopcd .= ",";
                }
                $shopcd .= $v;
            }
        }
        return $shopcd;
    }

    public function collectShopnameFromParams($params)
    {
        foreach ($params as $k => $v)
        {
            if (substr($k, 0, 8) == 'shopname')
            {
                // if ($shopname.length > 0) {
                // $shopname .= "　";
                // }
                $shopname .= $v . "　";
            }
        }
        return $shopname;
    }

    public function postAction()
    {
        $params = $this->getParameters();
        $step = $params["Step"];

        $this->_data['params'] = $params;

        $this->makeTemplateParams($params);

        if (empty($step))
        {
            $model_cam = new Mobileapi_Model_BukkenCampaign();
            $campaigns = $model_cam->getNormalCampaigns(); // キャンペーンデータ取得
            $this->_data['CAMPAIGNS'] = $campaigns;

            $this->displayBody2('index');
        }
        else if ($step == 1)
        {
            $model_cam = new Mobileapi_Model_BukkenCampaign();
            $campaigns = $model_cam->getNormalCampaigns(); // キャンペーンデータ取得
            $this->_data['CAMPAIGNS'] = $campaigns;

            $p_shopcds = $this->collectShopcdFromParams($params);
            $this->_data['params']['p_shopcds'] = $p_shopcds;

            $p_shopnames = $this->collectShopnameFromParams($params);
            $this->_data['params']['p_shopnames'] = $p_shopnames;

            $this->displayBody2('entry');
        }
        else if ($step == 2)
        {
            $p_campaigns = $this->collectCampaignFromParams($params);
            $this->_data['p_campaigns'] = $p_campaigns;

            $model_cam = new Mobileapi_Model_BukkenCampaign();
            $temp = $model_cam->getNormalCampaigns();

            if ($this->checkParams($params, $code))
            {
                // 入力にエラーがある場合
                $campaigns = array();
                foreach ($temp as $k => $cam)
                {
                    if (in_array($cam['M94_CAMPAIGN_CD'], $p_campaigns))
                    {
                        $cam['name'] = 'campaign' . $k;
                        $cam['checked'] = 1;
                    }
                    $campaigns[] = $cam;
                }
                $this->_data['CAMPAIGNS'] = $campaigns;
                $this->displayBody2('error');
            }
            else
            {
                // 入力にエラーがない場合
                $campaigns = array();
                foreach ($temp as $k => $cam)
                {
                    if (in_array($cam['M94_CAMPAIGN_CD'], $p_campaigns))
                    {
                        $cam['name'] = 'campaign' . $k;
                        $campaigns[] = $cam;
                    }
                }
                $this->_data['CAMPAIGNS'] = $campaigns;
                // 確認画面へ遷移
                $this->displayBody2('confirm');
            }
        }
        else if ($step == 3)
        {
            $cparams = array();
            $cparams['Tel'] = $params['Tel'];
            $cparams['Mail'] = $params['Mail'];
            // $cparams ['vintGenruFlg'] = 0;
            $cparams['NameSei'] = $params['KanjiSei'];
            $cparams['NameMei'] = $params['KanjiMei'];
            // 20141128 S_Add
            $cparams['NameSeiKana'] = $params['KanaSei'];
            $cparams['NameMeiKana'] = $params['KanaMei'];
            // 20141128 E_Add

            // 20141211 S_Add
            $cparams['Name'] = $params['KanjiSei'] . "　" . $params['KanjiMei']; // 名前
            $cparams['NameKana'] = $params['KanaSei'] . "　" . $params['KanaMei']; // 名前カナ
                                                                                  // 20141211
                                                                                  // E_Add

            // お問い合わせ内容チェックボックス
            $list = $this->extractParams($params, 'check');
            if (array_key_exists('check1', $params)) $cparams['Inquiry1'] = 1;
            if (array_key_exists('check2', $params)) $cparams['Inquiry2'] = 1;

            // パラメータ削除
            unset($params['campaignName']); // 20150128 Add

            // キャンペーン
            $list = $this->extractParams($params, 'campaign');
            $cparams['CampaignAgechau'] = join(';', $list);

            $cparams['Comment'] = $params['shosai'];

            $cparams['SrhType'] = $params['kind']; // 地域：1　路線・駅：2　店舗：3

            $cparams['kindname'] = $params['name']; // kindごとの名称
            $cparams['kindnameValue'] = $params['nameValue']; // kindごとの名称　表示

            $cparams['kindcode'] = $params['code']; // kindごとのコード

            $cparams['p_shopcds'] = $params['p_shopcds']; // 店舗コード
            $cparams['p_shopnames'] = $params['p_shopnames']; // 店舗名称

            $cparams['tinryo1'] = $params['tinryo1']; // 賃料min　DB
            $cparams['tinryo2'] = $params['tinryo2']; // 賃料max　DB
            $cparams['tinryo1Value'] = $params['tinryo1Value']; // 賃料min　表示
            $cparams['tinryo2Value'] = $params['tinryo2Value']; // 賃料max　表示
            $cparams['tinryo_jouken2'] = $params['tinryo_jouken2']; // 管理費・共益費含む　DB
            $cparams['tyusyajyo_komi'] = $params['tyusyajyo_komi']; // 駐車場代含む　DB

            $cparams['shikikin_nashi'] = $params['shikikin_nashi']; // 敷金ゼロ　DB
            $cparams['reikin_nashi'] = $params['reikin_nashi']; // 礼金ゼロ　DB

            $cparams['tinryoNotesValue'] = $params['tinryoNotesValue']; // 賃料備考　表示
            $cparams['syubetuValue'] = $params['syubetuValue']; // 建物種別　表示
            $cparams['syubetuDB'] = $params['syubetuDB']; // 建物種別　DB

            $cparams['ekitoho'] = $params['ekitoho']; // 駅徒歩　DB
            $cparams['bas_riyou'] = $params['bas_riyou']; // バス利用含む　DB

            $cparams['ekitohoValue'] = $params['ekitohoValue']; // 駅徒歩　表示

            $cparams['senyu1'] = $params['senyu1']; // 専有面積min　DB
            $cparams['senyu2'] = $params['senyu2']; // 専有面積max　DB
            $cparams['senyu1Value'] = $params['senyu1Value']; // 専有面積min　表示
            $cparams['senyu2Value'] = $params['senyu2Value']; // 専有面積max　表示

            $cparams['madoriValue'] = $params['madoriValue']; // 間取り　表示
            $cparams['madoriDB'] = $params['madoriDB']; // 間取り　DB

            $cparams['built'] = $params['built']; // 築年数　DB
            $cparams['builtValue'] = $params['builtValue']; // 築年数　表示

            $cparams['kodawariTypeDB'] = $params['kodawariTypeDB']; // こだわり条件　DB
            $cparams['kodawariDB'] = $params['kodawariDB']; // 人気のこだわり条件　DB

            $cparams['otherNotesValue'] = $params['otherNotesValue']; // その他　表示

            // 20150126 S_Add
            $cparams['isMobile'] = 1;
            $cparams['vintGenruFlg'] = 95;
            // 20150126 E_Add

            $cparams['TimeStr'] = date("Y/m/d H:i:s");

            $this->callInquiryApi('apiconditions', $cparams);

            $this->my_secure_redirect("sp/inquiry/conditionsentry/complete/");
        }
    }

    private function checkParams($params, $code)
    {
        $error = 0;

        // 姓・名の全角文字チェック
        $key = array();
        $key[] = 'kanji_sei';
        $key[] = 'kanji_mei';
        foreach ($key as $k)
        {
            if ($this->checkZenkaku($params[$k]))
            {
                $this->_data['name_error'] = 1;
                $this->_data[$k . '_error'] = "error";
                $error = 1;
            }
        }
        // セイ・メイの全角カナ文字チェック
        $key = array();
        $key[] = 'kana_sei';
        $key[] = 'kana_mei';
        foreach ($key as $k)
        {
            if ($this->checkZenkakuKana($params[$k]))
            {
                $this->_data['name_error'] = "error";
                $this->_data[$k . '_error'] = "error";
                $error = 1;
            }
        }
        // メールアドレス・電話番号チェック
        $params['mail'] = trim($params['mail']);
        $params['tel'] = trim($params['tel']);
        if (empty($params['mail']) && empty($params['tel']))
        {
            // メールアドレス・電話番号の両方が未入力の場合
            $this->_data['renraku_empty_error'] = "error";
            $this->_data['renraku_error'] = "error";
            $error = 1;
        }
        else
        {
            if (!empty($params['mail']) && $this->checkMail($params['mail']))
            {
                // メールアドレスが入力されているかつ、入力形式が正しくない場合
                $this->_data['mail_error'] = "error";
                $this->_data['renraku_error'] = "error";
                $error = 1;
            }
            if (!empty($params['tel']) && !preg_match("/^[0-9]+$/u", $params['tel']))
            {
                // 電話番号が入力されているかつ、入力形式が正しくない場合
                $this->_data['tel_error'] = "error";
                $this->_data['renraku_error'] = "error";
                $error = 1;
            }
        }
        // お問い合わせ内容チェック
        $checks = 0;
        for ($i = 1; $i <= 4; $i++)
        {
            // チェックボックス４つ分をループ
            if ($params['check' . $i] == 'on')
            {
                // チェックボックスonがあれば、+1
                $checks++;
            }
        }
        if ($checks == 0)
        {
            // チェックボックスがすべてoffの場合
            $this->_data['checks_error'] = "error";
            $error = 1;
        }
        // if (strlen ( $params ['shosai'] ) > 500) {
        // // 自由記載欄の文字数が500文字以上の場合
        // $this->_data ['shosai_error'] = "error";
        // $error = 1;
        // }

        return $error;
    }

    private function makeTemplateParams($params)
    {
        // 地域・駅・沿線項目の名称
        $names = explode('/', $params['name']);
        foreach ($names as $key => $val)
        {
            $names2 = explode(';', $val);
            if (strlen($names2[0]) > 0)
            {
                $nameValue .= '<li><span>' . $names2[0] . '</span></li>';
            }
            if (strlen($names2[1]) > 0)
            {
                $nameValue .= '<li>' . $names2[1] . '</li>';
            }
        }
        $this->_data['params']['nameValue'] = $nameValue;

        // 賃料min
        if ($params['tinryo1'] == 0)
        {
            $this->_data['params']['tinryo1Value'] = "下限なし";
            $this->_data['params']['tinryo1'] = 0;
        }
        else
        {
            $this->_data['params']['tinryo1Value'] = $params['tinryo1'] . "万円";
        }
        // 賃料max
        if ($params['tinryo2'])
        {
            if ($params['tinryo2'] == 999)
            {
                $this->_data['params']['tinryo2Value'] = "上限なし";
            }
            else
            {
                $this->_data['params']['tinryo2Value'] = $params['tinryo2'] . "万円";
            }
        }
        else
        {
            $this->_data['params']['tinryo2Value'] = "上限なし";
            $this->_data['params']['tinryo2'] = 999;
        }

        // 賃料備考
        $tinryoNotesCheck = 0;
        if ($params['tinryo_jouken2'] == 1)
        {
            $tinryoNotesValue = "管理費・共益費含む";
            $tinryoNotesCheck += 1;
        }
        if ($params['tyusyajyo_komi'] == 1)
        {
            if ($tinryoNotesCheck > 0)
            {
                $tinryoNotesValue .= "、";
            }
            $tinryoNotesValue .= "駐車場代含む";
            $tinryoNotesCheck += 1;
        }
        if ($params['shikikin_nashi'] == 1)
        {
            if ($tinryoNotesCheck > 0)
            {
                $tinryoNotesValue .= "、";
            }
            $tinryoNotesValue .= "敷金ゼロ";
            $tinryoNotesCheck += 1;
        }
        if ($params['reikin_nashi'] == 1)
        {
            if ($tinryoNotesCheck > 0)
            {
                $tinryoNotesValue .= "、";
            }
            $tinryoNotesValue .= "礼金ゼロ";
            $tinryoNotesCheck += 1;
        }
        if ($params['freerent'] == 1)
        {
            if ($tinryoNotesCheck > 0)
            {
                $tinryoNotesValue .= "、";
            }
            $tinryoNotesValue .= "フリーレント";
            $tinryoNotesCheck += 1;
        }
        if ($params['heyawari'] == 1)
        {
            if ($tinryoNotesCheck > 0)
            {
                $tinryoNotesValue .= "、";
            }
            $tinryoNotesValue .= "部屋割";
            $tinryoNotesCheck += 1;
        }
        if ($tinryoNotesCheck > 0)
        {
            $this->_data['params']['tinryoNotesValue'] = "（" . $tinryoNotesValue . "）";
        }

        // 間取り
        $madoriCheck = 0;
        if ($params['madori10'] == 1)
        {
            $madoriValue = "ワンルーム";
            $madoriDB = "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB = "0";
        }
        if ($params['madori11'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "1K";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori12'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "1DK";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori14'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "1LDK";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori21'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "2K";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori22'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "2DK";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori24'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "2LDK";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori31'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "3K";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori32'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "3DK";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori34'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "3LDK";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori41'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "4K";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori42'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "4DK";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori44'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "4LDK";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($params['madori51'] == 1)
        {
            if ($madoriCheck > 0)
            {
                $madoriValue .= "/";
            }
            $madoriValue .= "5K以上";
            $madoriDB .= "1";
            $madoriCheck += 1;
        }
        else
        {
            $madoriDB .= "0";
        }
        if ($madoriCheck > 0)
        {
            $this->_data['params']['madoriValue'] = $madoriValue;
        }
        $this->_data['params']['madoriDB'] = $madoriDB; // DB登録用

        // 専有面積min
        switch ($params['senyu1'])
        {
            case 1:
                $this->_data['params']['senyu1Value'] = "下限なし";
                break;
            case 2:
                $this->_data['params']['senyu1Value'] = "15&#13217;";
                break;
            case 3:
                $this->_data['params']['senyu1Value'] = "20&#13217;";
                break;
            case 4:
                $this->_data['params']['senyu1Value'] = "25&#13217;";
                break;
            case 5:
                $this->_data['params']['senyu1Value'] = "30&#13217;";
                break;
            case 6:
                $this->_data['params']['senyu1Value'] = "35&#13217;";
                break;
            case 7:
                $this->_data['params']['senyu1Value'] = "40&#13217;";
                break;
            case 8:
                $this->_data['params']['senyu1Value'] = "45&#13217;";
                break;
            case 9:
                $this->_data['params']['senyu1Value'] = "50&#13217;";
                break;
            case 10:
                $this->_data['params']['senyu1Value'] = "60&#13217;";
                break;
            case 11:
                $this->_data['params']['senyu1Value'] = "70&#13217;";
                break;
            case 12:
                $this->_data['params']['senyu1Value'] = "80&#13217;";
                break;
            case 13:
                $this->_data['params']['senyu1Value'] = "90&#13217;";
                break;
            case 14:
                $this->_data['params']['senyu1Value'] = "100&#13217;";
                break;
            case 15:
                $this->_data['params']['senyu1Value'] = "上限なし";
                break;
        }
        // 専有面積max
        switch ($params['senyu2'])
        {
            case 1:
                $this->_data['params']['senyu2Value'] = "下限なし";
                break;
            case 2:
                $this->_data['params']['senyu2Value'] = "15&#13217;";
                break;
            case 3:
                $this->_data['params']['senyu2Value'] = "20&#13217;";
                break;
            case 4:
                $this->_data['params']['senyu2Value'] = "25&#13217;";
                break;
            case 5:
                $this->_data['params']['senyu2Value'] = "30&#13217;";
                break;
            case 6:
                $this->_data['params']['senyu2Value'] = "35&#13217;";
                break;
            case 7:
                $this->_data['params']['senyu2Value'] = "40&#13217;";
                break;
            case 8:
                $this->_data['params']['senyu2Value'] = "45&#13217;";
                break;
            case 9:
                $this->_data['params']['senyu2Value'] = "50&#13217;";
                break;
            case 10:
                $this->_data['params']['senyu2Value'] = "60&#13217;";
                break;
            case 11:
                $this->_data['params']['senyu2Value'] = "70&#13217;";
                break;
            case 12:
                $this->_data['params']['senyu2Value'] = "80&#13217;";
                break;
            case 13:
                $this->_data['params']['senyu2Value'] = "90&#13217;";
                break;
            case 14:
                $this->_data['params']['senyu2Value'] = "100&#13217;";
                break;
            case 15:
                $this->_data['params']['senyu2Value'] = "上限なし";
                break;
        }

        // 物件種別（建物構造）
        $syubetuCheck = 0;
        if ($params['syubetu1'] == 1)
        {
            $syubetuValue = "賃貸アパート";
            $syubetuDB = "1";
            $syubetuCheck += 1;
        }
        else
        {
            $syubetuDB = "0";
        }
        if ($params['syubetu2'] == 1)
        {
            if ($syubetuCheck > 0)
            {
                $syubetuValue .= "、";
            }
            $syubetuValue .= "賃貸マンション";
            $syubetuDB .= "1";
            $syubetuCheck += 1;
        }
        else
        {
            $syubetuDB .= "0";
        }
        if ($params['syubetu3'] == 1)
        {
            if ($syubetuCheck > 0)
            {
                $syubetuValue .= "、";
            }
            $syubetuValue .= "戸建て・テラスハウス";
            $syubetuDB .= "1";
            $syubetuCheck += 1;
        }
        else
        {
            $syubetuDB .= "0";
        }
        if ($params['syubetu4'] == 1)
        {
            if ($syubetuCheck > 0)
            {
                $syubetuValue .= "、";
            }
            $syubetuValue .= "貸店舗・賃貸事務所";
            $syubetuDB .= "1";
            $syubetuCheck += 1;
        }
        else
        {
            $syubetuDB .= "0";
        }
        if ($params['syubetu5'] == 1)
        {
            if ($syubetuCheck > 0)
            {
                $syubetuValue .= "、";
            }
            $syubetuValue .= "駐車場";
            $syubetuDB .= "1";
            $syubetuCheck += 1;
        }
        else
        {
            $syubetuDB .= "0";
        }
        if ($syubetuCheck > 0)
        {
            $this->_data['params']['syubetuValue'] = $syubetuValue;
            $this->_data['params']['syubetuDB'] = $syubetuDB; // DB登録用
        }
        else
        {
            // すべてチェックなしの場合は、11111で登録
            $this->_data['params']['syubetuDB'] = "11111"; // DB登録用
        }

        // 築年数
        switch ($params['built'])
        {
            case 0:
                $this->_data['params']['builtValue'] = "指定なし";
                break;
            case 1:
                $this->_data['params']['builtValue'] = "新築";
                break;
            case 2:
                $this->_data['params']['builtValue'] = "3年以内";
                break;
            case 3:
                $this->_data['params']['builtValue'] = "5年以内";
                break;
            case 4:
                $this->_data['params']['builtValue'] = "10年以内";
                break;
        }

        // 駅徒歩
        switch ($params['ekitoho'])
        {
            case 0:
                $this->_data['params']['ekitohoValue'] = "指定なし";
                break;
            case 1:
                $this->_data['params']['ekitohoValue'] = "1分以内";
                break;
            case 2:
                $this->_data['params']['ekitohoValue'] = "5分以内";
                break;
            case 3:
                $this->_data['params']['ekitohoValue'] = "7分以内";
                break;
            case 4:
                $this->_data['params']['ekitohoValue'] = "10分以内";
                break;
            case 5:
                $this->_data['params']['ekitohoValue'] = "15分以内";
                break;
        }

        // バス利用含む
        if ($params['bas_riyou'] == 1)
        {
            // $this->_data ['params'] ['bas_riyouValue'] = "（バス利用含む）";
            $this->_data['params']['ekitohoValue'] .= "（バス利用含む）"; // 20150202 Add
        }

        // その他備考
        $otherNotesCheck = 0;
        // 人気のこだわり条件
        if ($params['kodawari_01'] == 1)
        {
            $otherNotesValue = "女性の一人暮らしに安心";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari_02'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "子育て応援します！";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari_03'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "料理がしやすい";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari_04'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ペットと暮らせるお部屋";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari_05'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "物がたくさん収納できる";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari_06'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ルームシェア向け";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari_07'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "リノベーション＆リフォーム物件";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari_08'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "冬でも暖かい";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari_09'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "高齢者の方も安心";
            $otherNotesCheck += 1;
        }
        // 構造種別
        if ($params['kodawari20'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "鉄骨造";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari21'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "鉄筋コンクリート造";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari136'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "鉄骨鉄筋コンクリート造";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari22'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "軽量鉄骨造";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari23'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "木造";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari20'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "その他";
            $otherNotesCheck += 1;
        }
        // コンセプト
        if ($params['kodawari116'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "リノベーション物件";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari117'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "リフォーム済み";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari118'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "日当たり良好";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari119'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "閑静な住宅街";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari120'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "タイル貼り";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari121'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "家具付きト";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari122'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "食器洗い乾燥機";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari94'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "デザイナーズ賃貸物件";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari125'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "分譲賃貸";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari126'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "タワーマンション";
            $otherNotesCheck += 1;
        }
        // 入居条件
        if ($params['kodawari9'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "即入居可";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari10'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ペット相談可";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari11'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "楽器相談可";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari18'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "家賃カード決済可";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari19'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "連帯保証人不要";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari15'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "女性限定";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari12'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "事務所可";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari132'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ルームシェア可";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari134'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "二人入居可";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari14'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "高齢者向け";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari133'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "特定優良賃貸住宅";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari135'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "マンスリー可";
            $otherNotesCheck += 1;
        }
        // 建物設備
        if ($params['kodawari31'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "エレベータ";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari95'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "バリアフリー";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari36'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ゴミ集積場";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari32'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "宅配ボックス";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari93'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "オール電化";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari130'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "都市ガス";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari131'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "プロパンガス";
            $otherNotesCheck += 1;
        }
        // テレビ・通信
        if ($params['kodawari55'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "CATV";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari54'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "CSアンテナ";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari53'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "BSアンテナ";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari97'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "インターネット対応";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari104'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "地デジ対応";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari103'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "地デジ対応TV付";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari56'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "有線";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari98'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "光ファイバー";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari111'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "インターネット月額利用料無料";
            $otherNotesCheck += 1;
        }
        // セキュリティ
        if ($params['kodawari75'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "TVインターフォン";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari33'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "オートロック";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari107'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "防犯カメラ";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari34'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "24時間緊急対応";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari123'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "管理人あり";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari124'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ディンプルキー";
            $otherNotesCheck += 1;
        }
        // 部屋環境
        if ($params['kodawari61'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "フローリング";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari62'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ロフト";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari77'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "メゾネット";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari46'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "エアコン";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari4'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "1階";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari5'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "2階以上";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari101'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "角部屋";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari73'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "専用庭";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari112'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "バルコニー・ベランダ";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari66'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "出窓";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari8'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "南向き";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari87'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "床暖房";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari127'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ルーフバルコニー";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari128'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "バルコニー2面以上";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari129'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "24時間換気システム";
            $otherNotesCheck += 1;
        }
        // キッチン
        if ($params['kodawari59'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "システムキッチン";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari60'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ガスキッチン";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari78'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ＩＨクッキングヒータ";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari114'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "コンロ2口以上";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari79'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "対面キッチン";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari67'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "冷蔵庫";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari80'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ディスポーザー";
            $otherNotesCheck += 1;
        }
        // バス・トイレ
        if ($params['kodawari65'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "バス・トイレ別";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari63'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "室内洗濯機置き場";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari83'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "独立洗面台";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari45'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "シャンプードレッサー";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari113'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "給湯";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari44'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "追い焚き";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari86'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "温水洗浄暖房便座";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari81'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "浴室換気乾燥機";
            $otherNotesCheck += 1;
        }
        // 収納
        if ($params['kodawari91'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "トランクルーム";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari68'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "床下収納";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari115'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "シューズボックス";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari70'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "クローゼット";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari90'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "ウォークインクローゼット";
            $otherNotesCheck += 1;
        }
        // 室外設備
        if ($params['kodawari7'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "駐車場";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari38'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "駐輪場";
            $otherNotesCheck += 1;
        }
        if ($params['kodawari39'] == 1)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= "バイク置き場";
            $otherNotesCheck += 1;
        }
        // キャンペーン・特集
        $campaignName = $params['campaignName'];
        if (strlen($campaignName) > 0)
        {
            if ($otherNotesCheck > 0)
            {
                $otherNotesValue .= "/";
            }
            $otherNotesValue .= $campaignName;
            $otherNotesCheck += 1;
        }
        if ($otherNotesCheck > 0)
        {
            $this->_data['params']['otherNotesValue'] = $otherNotesValue;
        }

        // こだわり条件　こだわり3
        $kodawariTypeCheck = 0;
        if ($params['kodawariType_01'] == 1)
        {
            $kodawariTypeDB = "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB = "0";
        }
        if ($params['kodawariType_02'] == 1)
        {
            $kodawariTypeDB .= "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB .= "0";
        }
        if ($params['kodawariType_03'] == 1)
        {
            $kodawariTypeDB .= "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB .= "0";
        }
        if ($params['kodawariType_04'] == 1)
        {
            $kodawariTypeDB .= "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB .= "0";
        }
        if ($params['kodawariType_05'] == 1)
        {
            $kodawariTypeDB .= "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB .= "0";
        }
        if ($params['kodawariType_06'] == 1)
        {
            $kodawariTypeDB .= "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB .= "0";
        }
        if ($params['kodawariType_07'] == 1)
        {
            $kodawariTypeDB .= "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB .= "0";
        }
        if ($params['kodawariType_08'] == 1)
        {
            $kodawariTypeDB .= "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB .= "0";
        }
        if ($params['kodawariType_09'] == 1)
        {
            $kodawariTypeDB .= "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB .= "0";
        }
        if ($params['kodawariType_10'] == 1)
        {
            $kodawariTypeDB .= "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB .= "0";
        }
        if ($params['kodawariType_11'] == 1)
        {
            $kodawariTypeDB .= "1";
            $kodawariTypeCheck += 1;
        }
        else
        {
            $kodawariTypeDB .= "0";
        }
        $this->_data['params']['kodawariTypeDB'] = $kodawariTypeDB; // DB登録用

        // 人気のこだわり条件　こだわり1
        if ($params['kodawari_01'] == 1)
        {
            $kodawariDB .= "1";
            $kodawariCheck += 1;
        }
        else
        {
            $kodawariDB .= "0";
        }
        if ($params['kodawari_02'] == 1)
        {
            $kodawariDB .= "1";
            $kodawariCheck += 1;
        }
        else
        {
            $kodawariDB .= "0";
        }
        if ($params['kodawari_03'] == 1)
        {
            $kodawariDB .= "1";
            $kodawariCheck += 1;
        }
        else
        {
            $kodawariDB .= "0";
        }
        if ($params['kodawari_04'] == 1)
        {
            $kodawariDB .= "1";
            $kodawariCheck += 1;
        }
        else
        {
            $kodawariDB .= "0";
        }
        if ($params['kodawari_05'] == 1)
        {
            $kodawariDB .= "1";
            $kodawariCheck += 1;
        }
        else
        {
            $kodawariDB .= "0";
        }
        if ($params['kodawari_06'] == 1)
        {
            $kodawariDB .= "1";
            $kodawariCheck += 1;
        }
        else
        {
            $kodawariDB .= "0";
        }
        if ($params['kodawari_07'] == 1)
        {
            $kodawariDB .= "1";
            $kodawariCheck += 1;
        }
        else
        {
            $kodawariDB .= "0";
        }
        if ($params['kodawari_08'] == 1)
        {
            $kodawariDB .= "1";
            $kodawariCheck += 1;
        }
        else
        {
            $kodawariDB .= "0";
        }
        if ($params['kodawari_09'] == 1)
        {
            $kodawariDB .= "1";
            $kodawariCheck += 1;
        }
        else
        {
            $kodawariDB .= "0";
        }
        $this->_data['params']['kodawariDB'] = $kodawariDB; // DB登録用
    }

}
?>
